package Demo01_15;

/**
 * Created by 14229 on 2020/1/16.
 */
public class Test14 {
    public static void main(String[] args) {

        String s = "this is a test of java";
        char[] chars = s.toCharArray();
        getCharNum(chars);
        String replace = s.replace("test", "").replace("java", "JAVASE");
        System.out.println(replace);
    }
    private static int getCharNum(char[] c){
        int count = 0;
        for (char c1 : c) {
            if (c1 == 's'){
                count++;
            }
        }
        System.out.println(" s 出现了"+count+"次");
        return count;
    }
}
